package javaTest01;

import java.util.Scanner;

public class ScoreJudge {
    public static void main(String[] args) {//计算成绩的等级
        Scanner input=new Scanner(System.in);
        System.out.println("输入你的成绩");
        System.out.println(getRes(input.nextInt()));
    }

    /**
     * @param score 输入的成绩
     * @return 相应输入的反馈
     */
    public static String getRes(int score){
        if (score<0||score>100){
            return "无效的输入!";
        }else {
            return "评分为:"+judgeScore(score);
        }
    }

    /**
     * @param score 输入的成绩
     * @return 对应成绩的评级
     */
    public static String judgeScore(int score){
        String res;
        if (score>60&&score<89)
            res="B";
        else if(score<60)
            res="C";
        else
            res="A";
        return res;
    }
}
